package dev.alm.api_service.controller;

import dev.alm.api_service.vo.CommonVo;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("test")
public class TestController {

    @GetMapping("hello")
    public String hello() {
        return "Hello World!";
    }

    @PostMapping("test_post")
    public Map testPost(@RequestBody CommonVo commonVo) {
        System.out.println("用户名：" + commonVo.getUsername());
        System.out.println("消息：" + commonVo.getMessage());
        Map<String, String> map = new HashMap<>();
        map.put("code", "200");
        map.put("message", "成功");
        map.put("data", "这是测试数据");
        return map;
    }

}